home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CUCD / Programming / AMOSList / AMOSLIST / text0155.txt < prev    next >
Encoding:
Text File  |  1998-04-01  |  849 b   |  29 lines

  1. If you used your own sorting technique rather than the one built into
  2. AMOS, things will be easier.  With 128 blocks the speed difference shouldn't
  3. really matter.
  4.  
  5. Here's a code fragment for you to mess around with.
  6. I'm typing this straight from my head, so it isn't tested.
  7.  
  8. For FOO=1 To 128
  9.   For FOO2=1 to 128
  10.     If NAME$(FOO)<NAME$(FOO2) And FOO<>FOO2
  11.       Swap NAME$(FOO),NAME$(FOO2)
  12.       Swap BANKNUM(FOO),BANKNUM(FOO2)
  13.     EndIf
  14.   Next
  15. Next
  16.  
  17. As well as the NAME$() array, I've also added a BANKNUM array which
  18. relates to NAME$() to tell you which bank has which name.
  19.  
  20. You may be able to get a better sorting algorithm yourself.
  21. Oh, and I'm not sure if the logic in the If statement is correct.  You
  22. may have to adjust it to NAME$(FOO)>NAME$(FOO2).
  23.  
  24. Maybe I'll be able to do more when I get the source.
  25.  
  26. Hope it works,
  27.               Nath.
  28.  
  29.